local achieved = achievements.GetValue( "LS: Suffocation", "total", 0 )

// Crudely check if LS2 is installed.
if ( achieved == 0 && !LS_umsg_hook ) then return end

local function Receive( msg )
	local hab = msg:ReadShort()
	local air = msg:ReadShort()

	if ( achieved != 1 && air == 0 ) then
		achievements.Update( "LS: Suffocation", 1, "" )
		achievements.SetValue( "LS: Suffocation", "total", 1 )
		achieved = 1
	end
	
	return hab, air
end
usermessage.AddHook( "LS_umsg", "Achievements.Suffocation", Receive ) 

achievements.Register( "LS: Suffocation", "Run out of air with Life Support 2.", "achievements/ls_suffocation", achieved, "" )